package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;

import javax.persistence.Entity;
import javax.persistence.Table;

import jsyf.oa.ientity.BaseEntity;

/**
 * Created by Administrator on 2018/1/10 0010.
 */
@Entity
@Table(name = "T_SYS_USER_LEAVE", schema = "oa", catalog = "")
public class UserLeaveEntity extends BaseEntity {

    private String userId;
    private String companyId;
    private String leaveDate;
    private String leaveReason;
    private Integer leaveType;
    private String auditAttachName;
    private String auditAttachUrl;
    private String leaveAttachName;
    private String leaveAttachUrl;
    private String leaveDescAttachName;
    private String leaveDescAttachUrl;
    private String leaveContractAttachName;
    private String leaveContractAttachUrl;
    private String leavePostDate;//离岗日期

    public String getLeavePostDate() {
        return leavePostDate;
    }

    public void setLeavePostDate(String leavePostDate) {
        this.leavePostDate = leavePostDate;
    }

    private UserEntity user;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getLeaveDate() {
        return leaveDate;
    }

    public void setLeaveDate(String leaveDate) {
        this.leaveDate = leaveDate;
    }

    public String getLeaveReason() {
        return leaveReason;
    }

    public void setLeaveReason(String leaveReason) {
        this.leaveReason = leaveReason;
    }

    public Integer getLeaveType() {
        return leaveType;
    }

    public void setLeaveType(Integer leaveType) {
        this.leaveType = leaveType;
    }

    public String getAuditAttachName() {
        return auditAttachName;
    }

    public void setAuditAttachName(String auditAttachName) {
        this.auditAttachName = auditAttachName;
    }

    public String getAuditAttachUrl() {
        return auditAttachUrl;
    }

    public void setAuditAttachUrl(String auditAttachUrl) {
        this.auditAttachUrl = auditAttachUrl;
    }

    public String getLeaveAttachName() {
        return leaveAttachName;
    }

    public void setLeaveAttachName(String leaveAttachName) {
        this.leaveAttachName = leaveAttachName;
    }

    public String getLeaveAttachUrl() {
        return leaveAttachUrl;
    }

    public void setLeaveAttachUrl(String leaveAttachUrl) {
        this.leaveAttachUrl = leaveAttachUrl;
    }

    public String getLeaveDescAttachName() {
        return leaveDescAttachName;
    }

    public void setLeaveDescAttachName(String leaveDescAttachName) {
        this.leaveDescAttachName = leaveDescAttachName;
    }

    public String getLeaveDescAttachUrl() {
        return leaveDescAttachUrl;
    }

    public void setLeaveDescAttachUrl(String leaveDescAttachUrl) {
        this.leaveDescAttachUrl = leaveDescAttachUrl;
    }

    public String getLeaveContractAttachName() {
        return leaveContractAttachName;
    }

    public void setLeaveContractAttachName(String leaveContractAttachName) {
        this.leaveContractAttachName = leaveContractAttachName;
    }

    public String getLeaveContractAttachUrl() {
        return leaveContractAttachUrl;
    }

    public void setLeaveContractAttachUrl(String leaveContractAttachUrl) {
        this.leaveContractAttachUrl = leaveContractAttachUrl;
    }

    public UserEntity getUser() {
        return user;
    }

    public void setUser(UserEntity user) {
        this.user = user;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", this.getId());
        obj.put("USER_ID", this.getUserId());
        obj.put("COMPANY_ID", this.getCompanyId());
        obj.put("LEAVE_DATE", this.getLeaveDate());
        obj.put("LEAVE_TYPE", this.getLeaveType());
        obj.put("LEAVE_REASON", this.getLeaveReason());
        obj.put("AUDIT_ATTACH_NAME", this.getAuditAttachName());
        obj.put("AUDIT_ATTACH_URL", this.getAuditAttachUrl());
        obj.put("LEAVE_ATTACH_NAME", this.getLeaveAttachName());
        obj.put("LEAVE_ATTACH_URL", this.getLeaveAttachUrl());
        obj.put("LEAVE_DESC_ATTACH_NAME", this.getLeaveDescAttachName());
        obj.put("LEAVE_DESC_ATTACH_URL", this.getLeaveDescAttachUrl());
        obj.put("LEAVE_CONTRACT_ATTACH_NAME", this.getLeaveContractAttachName());
        obj.put("LEAVE_CONTRACT_ATTACH_URL", this.getLeaveContractAttachUrl());
        obj.put("LEAVE_POST_DATE", this.getLeavePostDate());
        return obj;
    }

    @Override
    public String getTableName() {
        return "T_SYS_USER_LEAVE";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("USER_ID", "userId");
        obj.put("COMPANY_ID", "companyId");
        obj.put("LEAVE_DATE", "leaveDate");
        obj.put("LEAVE_TYPE", "leaveType");
        obj.put("LEAVE_REASON", "leaveReason");
        obj.put("AUDIT_ATTACH_NAME", "auditAttachName");
        obj.put("AUDIT_ATTACH_URL", "auditAttachUrl");
        obj.put("LEAVE_ATTACH_NAME","leaveAttachName");
        obj.put("LEAVE_ATTACH_URL", "leaveAttachUrl");
        obj.put("LEAVE_DESC_ATTACH_NAME","leaveDescAttachName");
        obj.put("LEAVE_DESC_ATTACH_URL", "leaveDescAttachUrl");
        obj.put("LEAVE_CONTRACT_ATTACH_NAME", "leaveContractAttachName");
        obj.put("LEAVE_CONTRACT_ATTACH_URL", "leaveContractAttachUrl");
        obj.put("LEAVE_POST_DATE", "leavePostDate");
        return obj;
    }

}
